﻿Imports Tohto.Base.DBUtility
Imports Tohto.Base.Entity
Imports Oracle.DataAccess.Client

Public Class CM0030B01

    ''' <summary>
    ''' パスワード変更処理
    ''' </summary>
    ''' <param name="loginId">ログイン情報．ログインID</param>
    ''' <param name="newPass">画面．新パスワード</param>
    ''' <param name="confirmPass">画面．確認</param>
    ''' <param name="errInfo">エラー情報</param>
    ''' <returns></returns>
    ''' <remarks></remarks>
    Public Function PasswordChange(ByVal loginId As String, ByVal newPass As String, ByVal confirmPass As String, ByRef errInfo As PLSQLErrorInfo) As DataSet
        Dim strCmdText As String
        strCmdText = "PG_CM0030.PASSWORD_CHANGE"

        Dim parameters(4) As OracleParameter

        Dim I_VC_LOGINID As New OracleParameter("I_VC_LOGINID", OracleDbType.Varchar2, ParameterDirection.Input)
        I_VC_LOGINID.Value = loginId

        Dim I_VC_PASSWORD_NEW As New OracleParameter("I_VC_PASSWORD_NEW", OracleDbType.Varchar2, ParameterDirection.Input)
        I_VC_PASSWORD_NEW.Value = newPass

        Dim I_VC_PASSWORD_CHECK As New OracleParameter("I_VC_PASSWORD_CHECK", OracleDbType.Varchar2, ParameterDirection.Input)
        I_VC_PASSWORD_CHECK.Value = confirmPass

        Dim O_CU_ERR As New OracleParameter("O_CU_ERR", OracleDbType.RefCursor, ParameterDirection.Output)
        Dim O_STATS As New OracleParameter("O_STATS", OracleDbType.Int32, ParameterDirection.ReturnValue)

        parameters(0) = I_VC_LOGINID
        parameters(1) = I_VC_PASSWORD_NEW
        parameters(2) = I_VC_PASSWORD_CHECK
        parameters(3) = O_CU_ERR
        parameters(4) = O_STATS

        Dim ds As DataSet

        ds = OracleHelp.FillTable(OracleHelp.ConnectionStringLocalTransaction,
                                           CommandType.StoredProcedure,
                                           strCmdText,
                                           errInfo,
                                           parameters)


        Return ds

    End Function
End Class
